package edu.sctu.practice.class02.shuqiqi.test18;

/**
 * Created by admin on 2015/10/29.
 */
//覆盖、继承
public class Auto {
    int tire;
    private String color;
    private double weight;
    double speed;
    public Auto auto;

    public  Auto(int tire,String color,double weight){
        this.setColor(color);
        this.speed=speed;
        this.setWeight(weight);
    }
    public  void SpeedUp(int a){
        speed=speed+a;
        System.out.println("加速后速度为:"+speed);
    }
    public  void SpeedDown(int b){
        speed=speed+b;
        System.out.println("减速后速度为:"+speed);
    }
    public void park(){
        System.out.println("可以停车");
    }

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }
}
